<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');
Yii::setPathOfAlias('editable', dirname(__FILE__).'/../extensions/x-editable');
Yii::setPathOfAlias('bootstrap', dirname(__FILE__).'/../extensions/bootstrap');
// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
	'basePath' => dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name' => 'Quản lý văn phòng điện tử',

	// preloading 'log' component
	'preload' => array('log'),
	'language' => 'vi',
	'defaultController'=>'congviec/congviec',
	// autoloading model and component classes
	'import' => array(
		'application.models.*',
		'application.components.*',
		/* 'application.modules.Multiselect.models.*',
        'application.modules.Multiselect.components.*',
		'application.modules.dm.models.*',
        'application.modules.dm.components.*',
        'application.modules.congvan.models.*',
        'application.modules.congvan.components.*',
		 'application.modules.congviec.components.*',
		'application.modules.QLDuAn.components.*',
        //modules CV
         'application.modules.CV.models.*',
        'application.modules.CV.components.*',
        //user modules
        
        // rights module
       
 		
       
        //jtogglecolumn
        'application.extensions.jtogglecolumn.*', 
        //ajaxlist
       
 		'application.extensions.AjaxList.AjaxList', */
 		//'application.extensions.editable.*',
 		'application.modules.rights.components.*',
 		'application.extensions.*',
 		'application.modules.user.models.*',
 		'application.modules.user.components.*',
 		 'application.modules.rights.*',
 		 'editable.*',  
 		/*  'application.extensions.chosen.Chosen', */
		'application.modules.hethong.*',
		'application.modules.hethong.components.*', 
	),

	'modules'=>array(
		'congviec'=>array('defaultController'=>'congviec'),
		'backup',
		'hethong',
		'congvan',
		'QLDuAn',
		'hdsd',
		'nhanvien',
		
		// uncomment the following to enable the Gii tool
		'gii'=>array(
			'class' => 'system.gii.GiiModule',
			'password' => 'sa78965412354!@#!#6',
		 	// If removed, Gii defaults to localhost only. Edit carefully to taste.
			'ipFilters' => array('127.0.0.1','::1'),
			 'generatorPaths' => array(
    	            'bootstrap.gii',
     	       ),
	
		),
		
        'dm',
      
       // 'CV',
       
        'user' => array(
                'tableUsers' => 'users',
                'tableProfiles' => 'canbo_vienchuc',
                'tableProfileFields' => 'profiles_fields',
        ),
       
        'rights' => array(         		
        	  'install' => false, // Whether to install rights. 
        		
        ), 
		 /* 'cal'=>array(
		 	'debug'=>true,
		 	'layout'=>'column1',
		 	), */
	),

	// application components
	'components' => array(
		 //X-editable config
        'editable' => array(
            'class'     => 'editable.EditableConfig',
            'form'      => 'bootstrap',        //form style: 'bootstrap', 'jqueryui', 'plain' 
            'mode'      => 'popup',            //mode: 'popup' or 'inline'  
            'defaults'  => array(              //default settings for all editable elements
            'emptytext' => '(Chưa có nội dung)'
            ),
        ),
      // 'session'=>array('autoStart'=>false),
		'user' => array(
			// enable cookie-based authentication
			//'allowAutoLogin'=>true,
			// 'class'=>'userGroups.components.WebUserGroups', // userGroup
			//'class'=>'RWebUser', // rights
			/*usser*/
			'class'=>'RWebUser',
                // enable cookie-based authentication
                'allowAutoLogin'=>true,
                'loginUrl'=>array('/user/login'),
		),
		'authManager' => array( 
			//'class'=>'RDbAuthManager', // Provides support authorization item sorting // rights
			/*usser*/
			 'class'=>'RDbAuthManager',
                'connectionID'=>'db',
                'defaultRoles'=>array('Authenticated', 'Guest'),
		 ),

		// uncomment the following to enable URLs in path-format
		 'bootstrap' => array(
            'class' => 'bootstrap.components.Bootstrap',
        ),
		'urlManager' => array(
			'urlFormat' => 'path',
			'rules' => array(
				'<controller:\w+>/<id:\d+>' => '<controller>/view',
				'<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
				'<controller:\w+>/<action:\w+>' => '<controller>/<action>',
				'congviec/<controller:\w+>/<action:\w+>/<id:\d+>' => 'congviec/<controller>/<action>',
                'congviec/<controller:\w+>/<action:\w+>' => 'congviec/<controller>/<action>',
			),
			'showScriptName'=>false,
		),
		
		/*'db'=>array(
			'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
		),*/
		// uncomment the following to use a MySQL database
		
		'db' => array(
			'connectionString' => 'mysql:host=localhost;dbname=qlcongviec_chauthanh',
			'emulatePrepare' => true,
			'username' => 'root',
			'password' => '',
			'charset' => 'utf8',
		),
		
		'errorHandler' => array(
			// use 'site/error' action to display errors
            'errorAction'=>'site/error',
        ),
		'log' => array(
			'class' => 'CLogRouter',
			'routes' => array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
				// uncomment the following to show log messages on web pages
			/* 	
				array(
					'class'=>'CWebLogRoute',
				),
				 */
			),
		),
		'counter' => array(
            'class' => 'UserCounter',
        ),
	),
	'theme'=>'bootstrap',
	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=>array(
		// this is used in contact page
		'adminEmail'=>'webmaster@example.com',
		
	),
);